#ifndef __EMERGENCY_CTRL_H__
#define __EMERGENCY_CTRL_H__

#include "app_main.h"

#include "cmsis_os2.h"
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#include "semphr.h"

#include "drv_gpio.h"
#include "pin.h"

#ifdef __cplusplus
extern "C" {
#endif

#define EMERGENCY_KEY_TIMEOUT   2000
#define EMERGENCY_PIN           GET_PIN(H, 3)

#define EMERGENCY_INIT          (1 << 0u)
#define EMERGENCY_WAIT          (1 << 1u)
#define EMERGENCY_START         (1 << 2u)
#define EMERGENCY_END           (1 << 3u)

int emergency_ctrl_fsm(app_t *emerg);
#ifdef __cplusplus
}
#endif

#endif  /* __RELAY_CTRL_H__ */


